<template>
  <el-button type="primary" @click="recover">还原</el-button>
</template>

<script setup lang="ts">
import {recoveryRecycleFile} from "@/api/disk/file";
import {fileStore} from "@/stores/disk/file";
import { ElMessage } from 'element-plus'
const store =fileStore()

//还原
const recover=async () => {
    const data= store.state.currentFiles
    if(store.state.currentBread.length>0){
      ElMessage.error('暂不支持单独还原子级文件,请将整个文件夹一起还原')
      return
    }
    await recoveryRecycleFile(data)
    store.resetFileList()
}
</script>

<style scoped>

</style>